
#include "mypushbutton.h"

MyPushButton::MyPushButton(QString normalImag, QString pressImag)
{
    this->normalPath = normalImag;
    this->pressPath = pressImag;

    QPixmap pix;
    bool ret = pix.load(this->normalPath);

    if (!ret) {
        qDebug() << "图片加载失败!";
    }

    //设置按钮固定尺寸
    this->setFixedSize(pix.width(), pix.height());

    //设置不规则样式
    this->setStyleSheet("QPushButton{border:0px;}");

    //设置图标
    this->setIcon(pix);

    //设置图标大小
    this->setIconSize(QSize(41, 41));
}
